package com.czl.module_service.fragment

import com.alibaba.android.arouter.facade.annotation.Route
import com.bumptech.glide.Glide
import com.czl.base.base.BaseFragment
import com.czl.base.config.AppConstants
import com.czl.base.util.ChoiceImgHelper
import com.czl.module_service.R
import com.czl.module_service.databinding.FragmentShowBigImgBinding
import com.czl.module_service.viewmodel.ShowBigImgViewModel
import com.czl.module_service.BR


/**
 * 创建日期：2022/3/17  16:05
 * 类说明:
 * @author：86152
 */
@Route(path = AppConstants.Router.Service.F_SERVICE_SHOW_BIG_IMG)
class ShowBigImgFragment : BaseFragment<FragmentShowBigImgBinding, ShowBigImgViewModel>() {

    private var img = ""

    override fun useBaseLayout(): Boolean = false;

    override fun initContentView(): Int = R.layout.fragment_show_big_img

    override fun initVariableId(): Int = BR.viewModel

    override fun initData() {
        Glide.with(requireContext()).load(img).into(binding.ivImage)
    }

    override fun initParam() {
        img = arguments?.getString(AppConstants.BundleKey.SHOW_BIG_IMG) ?: ""

    }

    override fun initViewObservable() {
        // viewModel中选择附件
        viewModel.uc.choiceImgEvent.observe(this, {
            back()
        })
    }

}